package com.yalemang.photovalut.base.utils

import android.graphics.drawable.Drawable
import com.yalemang.photovalut.base.helper.CommonDrawableHelper.*

class AppDrawableUtils {

    fun getRoundColorDrawable(color: Int): Drawable {
        return  Builder()
            .setShapeType(ShapeType.Oval)
            .setColor(color)
            .builder()
    }

    fun getShapeDrawable(
        color: Int,
        topLeftRadius: Float,
        topRightRadius: Float,
        bottomLeftRadius: Float,
        bottomRightRadius: Float
    ): Drawable {
        return Builder()
            .setShapeType(ShapeType.RoundRectangle)
            .setColor(color)
            .setLeftTopRadius(topLeftRadius)
            .setRightTopRadius(topRightRadius)
            .setLeftBottomRadius(bottomLeftRadius)
            .setRightBottomRadius(bottomRightRadius)
            .builder()
    }

    fun getShapeDrawable(color: Int, top: Float, bottom: Float): Drawable {
        return getShapeDrawable(color, top, top, bottom, bottom)
    }

    fun getShapeDrawable(color: Int, dp: Float): Drawable {
        return getShapeDrawable(color, dp, dp, dp, dp)
    }

    fun getTopShapeDrawable(color: Int, top: Float): Drawable {
        return getShapeDrawable(color, top, top, 0f, 0f)
    }

    fun getBottomShapeDrawable(color: Int, bottom: Float): Drawable {
        return getShapeDrawable(color, 0f, 0f, bottom, bottom)
    }

    fun getShapeDrawable(color: Int): Drawable {
        return getShapeDrawable(color, 0f, 0f, 0f, 0f)
    }

}